package book;

public class BooList {
    private Book[] books;//存放书籍
    private static final int DEFAULT_SIZE = 10;

    private int usedSize; // 有效书籍的个数
    public BooList() {
        this.books = new Book[DEFAULT_SIZE];
        this.books[0] = new Book("骆驼祥子","老舍",26,"小说",false);
        this.books[1] = new Book("雷雨","曹禺",24,"戏剧",true);
        this.books[2] = new Book("再别康桥","徐志摩",19,"诗歌",false);
        this.books[3] = new Book("五猖会","鲁迅",21,"散文",false);
        this.usedSize = 3;
    }
    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
    public Book getBook(int pos){
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        books[pos] = book;
    }
}
